package com.sean.reverse.exception;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author sean
 * @createTime 2022/5/6 11:30
 * @description
 */
@Slf4j
@RestControllerAdvice(basePackages = "com.sean.reverse.controller")
public class HandleException {

    @ExceptionHandler(ThreadExistException.class)
    public void handleThreadExistException(ThreadExistException e){
        log.error("线程创建出现问题：{}，异常类型：{}",e.getMessage(),e.getClass());
    }

    @ExceptionHandler(CookieErrorException.class)
    public void handleCookieErrorException(CookieErrorException e){
        log.error("Cookie出现问题：{}，异常类型：{}",e.getMessage(),e.getClass());
    }
}
